#include "cw2015.h"

//读取电量
void cw2015_get_electric_quantity(uint8_t *electric_quantity)
{
    uint8_t data = 0;
    uint8_t CW2015_WEAK_UP = 0x00;
    hal_i2c_mem_write(I2C_MASTER_NUM, CW2015_ADDR, 0x0a, &CW2015_WEAK_UP, 1);
    hal_i2c_mem_read(I2C_MASTER_NUM, CW2015_ADDR, CW2015_REG_SOC, &data, 1);
    *electric_quantity = data;
}
